package org.price.sql.repo.session.core;

import java.sql.Connection;
import java.util.Hashtable;
import java.util.Map;

import org.price.sql.repo.session.SessionFactory;

public class Core {

    private static Map<String, Object> properties;

    public static final String BASE = "base";

    public static final String CONNECTION = "org.price.sql.connection";

    public static final String DIALECT_DETECTOR = "org.price.sql.dialectDetector";

    private Core() {

    }

    public static Map<String, Object> getProperties() {
        if (properties == null) {
            properties = new Hashtable<String, Object>();
        }
        return properties;
    }

    public static void setProperties(Map<String, Object> properties) {
        Core.properties = properties;
    }

    public static final SessionFactory newSessionFactory() {
        return new SessionFactoryImpl((Connection) getProperties().get(
                CONNECTION));
    }
}
